package com.atguigu.am_demo.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhaodf
 */
@RestController
public class HelloController {


    @GetMapping("/hello")
    public String hello() {
        return SecurityContextHolder.getContext().getAuthentication().getName();
    }
}
